﻿using OA.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace OA.IDAL
{
    public interface IBaseRepository<T> where T:BaseModel
    {
        void Add(T entity);
        void Edit(T entity);
        void Delete(T entity);
        void Delete(int id);
        Task<T> GetEntityAsync(int id, bool tracking = false);
        Task<T> GetEntityAsync(Expression<Func<T, bool>> where, bool tracking = false);
        IQueryable<T> GetList(Expression<Func<T, bool>> where);
        IQueryable<T> GetList<O>(Expression<Func<T, bool>> where, int pageIndex, int pageSize, out int total, Expression<Func<T, O>> orderFieled, bool isAsc = true);

    }
}
